package com.tanhua;

import com.tanhua.oss.OssProperties;
import com.tanhua.oss.OssTemplate;
import com.tanhua.sms.SmsProperties;
import com.tanhua.sms.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/*
*   自动装配类
*
* */
@EnableConfigurationProperties({SmsProperties.class, OssProperties.class})
public class TanhuaAutoConfig {

    @Bean
    public SmsTemplate smsTemplate(SmsProperties smsProperties) {
        return new SmsTemplate(smsProperties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties) {
        return new OssTemplate(ossProperties);
    }
}
